<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        let a = 10;
        let b = 9;
        // a和b都是数值，值传递是拷贝值而不影响原来的值
        function fun1(a,b){
            let temp = a;
            a = b;
            b = temp;
        }
        fun1(a,b);
        console.log(`a = ${a},b = ${b}`);

        let c = {
            name:"名称",
            age:"年龄"
        }

        function fun2(obj){
            obj.name = "名称变了";
            obj.age = "年龄也变了";
        }

        fun2(c);
        console.log(JSON.stringify(c));
    </script>
</body>
</html>